package com.example.springdemo.retry;

import cn.cool.middleware.biz_exception_retry.types.annotation.BizExceptionRetry;
import org.springframework.stereotype.Service;

@Service
public class RetryService {
    private boolean flag = true;
    //retry(int,String)
    @BizExceptionRetry(exceptionType = "测试1", exceptionDesc = "测试2", memoryRetryMaxNum = 6, enableMemoryRetry = false, retryBeanName = "strategy")
    public int retry(int x, String y) {
        System.out.println("目标方法执行");
        if (flag) {
//            flag = false;
            int i = 1 / 0;
        }
        return 1;
    }
}
